<template>
    <div class="child">
        <h2>子组件数据</h2>
        <hr>
        <h3>求和为: {{ num }}</h3>
    </div>
</template>

<script setup lang="ts" name="Child">
import axios from 'axios';
import {ref} from 'vue'
let num = ref(0)
let {data} = await axios.get('https://api.uomg.com/api/rand/qinghua?format=json');
console.log(data,"获取子组件接口数据");
</script>

<style scoped>
    .child{
        background-color: #ffffff;
        padding: 20px;
        border-radius: 10px;
    }
</style>